﻿using System;
using System.Configuration;
using System.Diagnostics;

namespace Dotnet.Utils.Utility.Config
{
    public static class RuntimeUtil
    {
        public static bool IsDebugMode()
        {
            return IsVsDebugMode() || IsDebugModeSetting();
        }

        public static bool IsVsDebugMode()
        {
            return Debugger.IsAttached;
        }

        public static bool IsDebugModeSetting()
        {
            return ConfigurationManager.AppSettings["DebugMode"].Equals("true", StringComparison.InvariantCultureIgnoreCase);
        }
    }
}